package com.anbinh.doctor.ui;

import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.AutoCompleteTextView;

public class RobotoAutoCompleteText extends AutoCompleteTextView {

    public RobotoAutoCompleteText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    public RobotoAutoCompleteText(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public RobotoAutoCompleteText(Context context) {
        super(context);
        init();
    }

    private void init() {
        if (!isInEditMode()) {
            try {
                Typeface tf = Typeface.createFromAsset(
                        getContext().getAssets(), "fonts/Roboto-Light.ttf");
                setTypeface(tf);
            } catch (Exception e) {
                // TODO: handle exception
            }
        }
    }
}
